home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 09 - 1993 / 09.07 Jul 93 / Bedrock Header Files / Support Includes / BRTime.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-04-19  |  6.0 KB  |  203 lines  |  [TEXT/MPS ]

  1.  
  2. /*========================================================================================
  3.   / 
  4.   /      File:        BRTime.h
  5.   /      Release Version:    $ 1.0d1 $
  6.   / 
  7.   /      Creation Date:    November 3, 1989
  8.   / 
  9.   /      COPYRIGHT 1989-93 SYMANTEC CORPORATION. ALL RIGHTS RESERVED. UNPUBLISHED -- RIGHTS
  10.   /      RESERVED UNDER THE COPYRIGHT LAWS OF THE UNITED STATES. USE OF COPYRIGHT NOTICE IS
  11.   /      PRECAUTIONARY ONLY AND DOES NOT IMPLY PUBLICATION OR DISCLOSURE.
  12.   / 
  13.   /      THIS SOFTWARE CONTAINS PROPRIETARY AND CONFIDENTIAL INFORMATION OF SYMANTEC
  14.   /      CORPORATION. USE, DISCLOSURE, OR REPRODUCTION IS PROHIBITED WITHOUT THE PRIOR
  15.   /      EXPRESS WRITTEN PERMISSION OF SYMANTEC CORPORATION.
  16.   / 
  17.   /      RESTRICTED RIGHTS LEGEND
  18.   /      Use, duplication, or disclosure by the Government is subject to restrictions as Set
  19.   /      forth in subparagraph (c)(l)(ii) of the Rights in Technical Data and Computer
  20.   /      Software clause at DFARS 252.227-7013. Symantec Corporation, 10201 Torre Avenue,
  21.   /      Cupertino, CA 95014.
  22.   / 
  23.   /=======================================================================================*/
  24.  
  25.  
  26. /*--------------------------------------------------------------------------------------
  27. //    This file is part of the old international implementation.
  28. //    The Bedrock team is in the process of designing a totally new approach.
  29. //    For more details on the new approach please look in the 
  30. //    "…:BEDROCK:INTL:INCLUDES:" folder.
  31. //    The new approach departs from the close tie to characters and characterSets.
  32. //    Instead it bases all internationalization efforts on locale based
  33. //    characters, and character sets, with Unicode as the central set.
  34. /--------------------------------------------------------------------------------------*/
  35.  
  36.  
  37. #ifndef BRTIME_H
  38. #define BRTIME_H
  39.  
  40. #ifndef BRSUPDEF_H
  41. #include "BRSupDef.h"
  42. #endif
  43.  
  44. #ifdef __cplusplus
  45. extern "C"
  46. {
  47. #endif
  48.  
  49.  
  50. typedef enum
  51. {
  52.     BR_CalendarType_kGregorian, BR_CalendarType_kJulian, BR_CalendarType_kLunar, BR_CalendarType_kHebrew
  53. } BR_CalendarType;
  54.  
  55. typedef    unsigned short BR_Year;
  56. typedef    unsigned short BR_Month;
  57. typedef    unsigned short BR_Week;
  58. typedef    unsigned short BR_Day;
  59. typedef    unsigned short BR_Hour;
  60. typedef    unsigned short BR_Minute;
  61. typedef    unsigned short BR_Second;
  62. typedef    unsigned short BR_Hundredths;
  63. typedef    unsigned long  BR_LongHundredths;
  64. typedef    unsigned long  BR_Ticks;
  65. typedef    short            BR_Duration;
  66.  
  67. typedef struct BR_SDateTime
  68. {
  69.     BR_CalendarType            fCalendar;
  70.     BR_Year                 fYear;
  71.     BR_Month                 fMonth;
  72.     BR_Week                 fWeek;
  73.     BR_Week                 fWeekOfMonth;
  74.     BR_Day                     fDay;
  75.     BR_Day                     fDayOfYear;
  76.     BR_Day                     fDayOfWeek;
  77.     BR_Hour                 fHour;
  78.     BR_Minute                 fMinute;
  79.     BR_Second                 fSecond;
  80.     BR_Hundredths             fHundredths;
  81.     BR_Boolean                 fLeapYear;
  82.     BR_Boolean                 fDaylightSavings;
  83. } BR_SDateTime, FAR* BR_SDateTimePtr;
  84.  
  85. typedef struct BR_SPackedDateTime
  86. {
  87.     BR_Year                 fYear;
  88.     BR_LongHundredths         fHundredths;
  89. } BR_SPackedDateTime, FAR* BR_SPackedDateTimePtr;
  90.  
  91. typedef long BR_FastDateTime, FAR* BR_FastDateTimePtr;
  92.  
  93.  
  94. typedef enum
  95. {
  96.     BR_DateTimeSet_kYear = (0x0001),
  97.     BR_DateTimeSet_kMonth = (0x0002),
  98.     BR_DateTimeSet_kWeek = (0x0004), 
  99.     BR_DateTimeSet_kWeekOfMonth = (0x0008),
  100.     BR_DateTimeSet_kDay = (0x0010),
  101.     BR_DateTimeSet_kDayOfYear = (0x0020),
  102.     BR_DateTimeSet_kDayOfWeek = (0x0040),
  103.     BR_DateTimeSet_kHour = (0x0080),
  104.     BR_DateTimeSet_kMinute = (0x0100),
  105.     BR_DateTimeSet_kSecond = (0x0200),
  106.     BR_DateTimeSet_kHundredth = (0x0400)
  107. } BR_DateTimeSet;
  108.  
  109. typedef enum
  110. {
  111.     BR_DurationUnit_kYears, BR_DurationUnit_kMonths, BR_DurationUnit_kWeeks, BR_DurationUnit_kDays, BR_DurationUnit_kHours, BR_DurationUnit_kMinutes, BR_DurationUnit_kSeconds, BR_DurationUnit_kHundredths
  112. } BR_DurationUnit;
  113.  
  114.  
  115. /* Date Time Procedures */
  116.  
  117. EXPENTRY(short)BR_DTInit(void);
  118.  
  119. BR_EXPORTENTRY(BR_SystemError) BR_GetDateTime(BR_SDateTimePtr dt);
  120.  
  121. BR_EXPORTENTRY(BR_SystemError) BR_SetDateTime(BR_SDateTimePtr dt);
  122.  
  123. BR_EXPORTENTRY(BR_SystemError) BR_AdjustDateTime(BR_SDateTimePtr dt, BR_DateTimeSet valid);
  124.  
  125.  
  126. BR_EXPORTENTRY(BR_SystemError) BR_SetFastDateTimeBase(BR_SDateTimePtr dt, long inc);
  127.  
  128.  
  129.  
  130. BR_EXPORTENTRY(BR_SystemError) BR_DateTimeToFastDateTime(
  131.     BR_FastDateTimePtr fastDT,
  132.     BR_SDateTimePtr dt);
  133.  
  134. BR_EXPORTENTRY(BR_SystemError) BR_FastDateTimeToDateTime(
  135.     BR_SDateTimePtr dt, 
  136.     BR_FastDateTimePtr fastDT);
  137.  
  138.  
  139. BR_EXPORTENTRY(BR_SystemError) BR_DurationToFastDateTime(
  140.     BR_FastDateTimePtr fastDT,
  141.     BR_Duration duration, 
  142.     BR_DurationUnit unit);
  143.  
  144. BR_EXPORTENTRY(BR_SystemError) BR_AddDurationToFastDateTime(
  145.     BR_FastDateTimePtr fastDT,
  146.     BR_Duration duration,
  147.     BR_DurationUnit unit);
  148.  
  149. BR_EXPORTENTRY(BR_SystemError) BR_AddDurationToDateTime(
  150.     BR_SDateTimePtr dt,
  151.     BR_Duration duration, 
  152.     BR_DurationUnit unit);
  153.  
  154.  
  155. BR_EXPORTENTRY(BR_SDateTimePtr) BR_PackedDateTimeToDateTime(
  156.     BR_SDateTimePtr dt,
  157.     BR_SPackedDateTimePtr pdt);
  158.     
  159. BR_EXPORTENTRY(BR_SPackedDateTimePtr) BR_DateTimeToPackedDateTime(
  160.     BR_SPackedDateTimePtr pdt,
  161.     BR_SDateTimePtr dt);
  162.  
  163. BR_EXPORTENTRY(BR_SPackedDateTimePtr) BR_DateTimeToGMTPackedDateTime(
  164.     BR_SPackedDateTimePtr pdt,
  165.     BR_SDateTimePtr dt);
  166.     
  167. BR_EXPORTENTRY(BR_SDateTimePtr) BR_GMTPackedDateTimeToDateTime(
  168.     BR_SDateTimePtr dt,
  169.     BR_SPackedDateTimePtr pdt);
  170.  
  171. BR_EXPORTENTRY(BR_SystemError) BR_PackedDateTimeToFastDateTime(
  172.     BR_FastDateTimePtr fdt,
  173.     BR_SPackedDateTimePtr pdt);
  174.     
  175. BR_EXPORTENTRY(BR_SystemError) BR_FastDateTimeToPackedDateTime(
  176.     BR_SPackedDateTimePtr pdt,
  177.     BR_FastDateTimePtr fdt);
  178.  
  179. BR_EXPORTENTRY(short) BR_CompareDateTime(BR_SDateTimePtr dt1, BR_SDateTimePtr dt2);
  180.  
  181. BR_EXPORTENTRY(BR_Boolean) BR_IsLeapYear(BR_Year fYear);
  182. BR_EXPORTENTRY(BR_Day) BR_DaysInYear(BR_Year fYear);
  183. BR_EXPORTENTRY(BR_Day) BR_DaysInMonth(BR_Year fYear, BR_Month fMonth);
  184. BR_EXPORTENTRY(BR_Day) BR_DayOfYear(BR_Year fYear, BR_Month fMonth, BR_Day fDay);
  185. BR_EXPORTENTRY(void) BR_GetMonthAndDay (
  186.     BR_Year fYear, 
  187.     BR_Day fDayOfYear,
  188.     BR_Month FAR * fMonth,
  189.     BR_Day FAR * fDay);
  190.     
  191. BR_EXPORTENTRY(BR_Year) BR_LeapYearsTo(BR_Year fYear);
  192. BR_EXPORTENTRY(BR_Day) BR_DayOfWeek(BR_Year fYear, BR_Month fMonth, BR_Day fDay);
  193.  
  194. BR_EXPORTENTRY(void) BR_FillInDateTime(BR_SDateTimePtr dt, BR_DateTimeSet valid);
  195.  
  196. #ifdef __cplusplus
  197. }
  198. #endif
  199.  
  200. #endif
  201.  
  202.  
  203.